/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.epos.servings;

//import cn.ekuma.epos.datalogic.I_DataLogicCustomers;
import com.openbravo.pos.base.AppLocal;
import e.odbo.data.dao.I_DataLogic;
import cn.ekuma.data.ui.swing.SwingEditorRecord;
import cn.ekuma.epos.datalogic.I_DataLogicSales;
import com.openbravo.data.basic.BasicException;
import com.openbravo.data.user.EditorListener;

import com.openbravo.pos.model.AbstractPosSwingModel;
import com.openbravo.pos.model.BaseSwingModel;
import com.openbravo.bean.Service;
import cn.ekuma.epos.panel.JPanelTableDAO;
import java.awt.Component;

/**
 *
 * @author Administrator
 */

public class JServicePanel extends JPanelTableDAO<Service> implements EditorListener {
    private JServiceEditor jeditor;
    private JServiceFilter jServiceFilter;
    private I_DataLogicSales m_dlSales = null;

    public JServicePanel() {
    }

     @Override
    protected void init() {
        jServiceFilter = new JServiceFilter(m_dlSales);
        jeditor=new JServiceEditor(m_dlSales,dirty);
    }

    @Override
    public SwingEditorRecord getEditor() {
        return jeditor;
    }

    @Override
    public Component getFilter() {
        return jServiceFilter.getComponent();
    }

    @Override
    public void updateValue(Object value) {
    }

    @Override
    public String getTitle() {
        return AppLocal.getIntString("Menu.Service");
    }

    public void activate() throws BasicException {
        jeditor.activate();
        jServiceFilter.activate();
        super.activate();
    }

    @Override
    public I_DataLogic getDataLogic() {
       return m_dlSales;
    }

    @Override
    public Class getSuportClass() {
        return Service.class;
    }

    @Override
    public String getObjectRenderString(Service value) {
       return value.getM_sName();
    }

	@Override
	public String getModelName() {	
		return BaseSwingModel.NAME;
	}

	@Override
	public void setModel(AbstractPosSwingModel mode) {
		 m_dlSales = mode.getDLSales();
	}
}